summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Orzechowski <alex@ozal.ski>2022-12-13 19:17:19 +0100
committerAlexander Orzechowski <alex@ozal.ski>2022-12-13 19:23:35 +0100
commit45fcde817e0455b2e92ee86417688e53a6742b4b (patch)
tree11c1147413262099adbeac594566794d1ea077d2
parentRenderWidget: Set WA_DontCreateNativeAncestors (diff)
downloadyuzu-45fcde817e0455b2e92ee86417688e53a6742b4b.tar
yuzu-45fcde817e0455b2e92ee86417688e53a6742b4b.tar.gz
yuzu-45fcde817e0455b2e92ee86417688e53a6742b4b.tar.bz2
yuzu-45fcde817e0455b2e92ee86417688e53a6742b4b.tar.lz
yuzu-45fcde817e0455b2e92ee86417688e53a6742b4b.tar.xz
yuzu-45fcde817e0455b2e92ee86417688e53a6742b4b.tar.zst
yuzu-45fcde817e0455b2e92ee86417688e53a6742b4b.zip
-rw-r--r--src/yuzu/main.cpp13
-rw-r--r--src/yuzu/main.h1
2 files changed, 10 insertions, 4 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 6c204416f..885e24990 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -2915,9 +2915,14 @@ static QScreen* GuessCurrentScreen(QWidget* window) {
});
}
+bool GMainWindow::UsingExclusiveFullscreen() {
+ return Settings::values.fullscreen_mode.GetValue() == Settings::FullscreenMode::Exclusive ||
+ QGuiApplication::platformName() == QStringLiteral("wayland");
+}
+
void GMainWindow::ShowFullscreen() {
- const auto show_fullscreen = [](QWidget* window) {
- if (Settings::values.fullscreen_mode.GetValue() == Settings::FullscreenMode::Exclusive) {
+ const auto show_fullscreen = [this](QWidget* window) {
+ if (UsingExclusiveFullscreen()) {
window->showFullScreen();
return;
}
@@ -2945,7 +2950,7 @@ void GMainWindow::ShowFullscreen() {
void GMainWindow::HideFullscreen() {
if (ui->action_Single_Window_Mode->isChecked()) {
- if (Settings::values.fullscreen_mode.GetValue() == Settings::FullscreenMode::Exclusive) {
+ if (UsingExclusiveFullscreen()) {
showNormal();
restoreGeometry(UISettings::values.geometry);
} else {
@@ -2959,7 +2964,7 @@ void GMainWindow::HideFullscreen() {
statusBar()->setVisible(ui->action_Show_Status_Bar->isChecked());
ui->menubar->show();
} else {
- if (Settings::values.fullscreen_mode.GetValue() == Settings::FullscreenMode::Exclusive) {
+ if (UsingExclusiveFullscreen()) {
render_window->showNormal();
render_window->restoreGeometry(UISettings::values.renderwindow_geometry);
} else {
diff --git a/src/yuzu/main.h b/src/yuzu/main.h
index 62d629973..27644fae5 100644
--- a/src/yuzu/main.h
+++ b/src/yuzu/main.h
@@ -320,6 +320,7 @@ private slots:
void OnDisplayTitleBars(bool);
void InitializeHotkeys();
void ToggleFullscreen();
+ bool UsingExclusiveFullscreen();
void ShowFullscreen();
void HideFullscreen();
void ToggleWindowMode();